#include<iostream>
using namespace std;
void move(char source,char target)
{
	cout<<source<<"-->"<<target<<endl;
}
void hannoi(int n,char source,char temp,char target)
{
	if(n==1)
	{
		move (source,target);
	}
	else
	{
		hannoi(n-1,source,target,temp);
		move(source,target);
		hannoi(n-1,temp,source,target);
	}
}
int main()
{
	int n=0;
	cin>>n;
	hannoi(n,'A','B','C');
	return 0;
 } 
